<!doctype html>
<html class="no-js">

<head>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
<title>{if !empty($_W['page']['sitename'])}{$_W['page']['sitename']}{else}{$_W['account']['name']}{/if}{if !empty($title)}{$title} {/if}</title>

<link rel="stylesheet" type="text/css" href="{$plus}dan/amazeui/css/amazeui.css"/>
<link rel="stylesheet" type="text/css" href="{$plus}dan/mobile/css/style.css?t=4" />

<script type="text/javascript" src="{$plus}dan/amazeui/js/jquery.min.js"></script>
<script type="text/javascript" src="{$res}js/layer-m/layer.js"></script>
<script type="text/javascript" src="{$plus}dan/amazeui/js/amazeui.min.js"></script>
<script type="text/javascript" src="{$plus}dan/amazeui/js/fastclick.min.js"></script>




<script>$(function() {FastClick.attach(document.body);});</script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
<script type="text/javascript">
	if(navigator.appName == 'Microsoft Internet Explorer'){
		if(navigator.userAgent.indexOf("MSIE 5.0")>0 || navigator.userAgent.indexOf("MSIE 6.0")>0 || navigator.userAgent.indexOf("MSIE 7.0")>0) {
			alert('您使用的 IE 浏览器版本过低, 推荐使用 Chrome 浏览器或 IE8 及以上版本浏览器.');
		}
	}
	window.sysinfo = {
		{if !empty($_W['uniacid'])}'uniacid': '{$_W['uniacid']}',{/if}
		{if !empty($_W['acid'])}'acid': '{$_W['acid']}',{/if}{if !empty($_W['openid'])}'openid': '{$_W['openid']}',{/if}
		{if !empty($_W['uid'])}'uid': '{$_W['uid']}',{/if}
		'siteroot': '{$_W['siteroot']}',
		'siteurl': '{$_W['siteurl']}',
		'attachurl': '{$_W['attachurl']}',
		'attachurl_local': '{$_W['attachurl_local']}',
		'attachurl_remote': '{$_W['attachurl_remote']}',
		{if defined('MODULE_URL')}'MODULE_URL': '{MODULE_URL}',{/if}
		'cookie' : {'pre': '{$_W['config']['cookie']['pre']}'}
	};
	// jssdk config 对象
	jssdkconfig = {php echo json_encode($_W['account']['jssdkconfig']);} || {};
	// 是否启用调试
	jssdkconfig.debug = false;
	jssdkconfig.jsApiList = [
		'checkJsApi',
		'onMenuShareTimeline',
		'onMenuShareAppMessage',
		'onMenuShareQQ',
		'onMenuShareWeibo',
		'hideMenuItems',
		'showMenuItems',
		'hideAllNonBaseMenuItem',
		'showAllNonBaseMenuItem',
		'translateVoice',
		'startRecord',
		'stopRecord',
		'onRecordEnd',
		'playVoice',
		'pauseVoice',
		'stopVoice',
		'uploadVoice',
		'downloadVoice',
		'chooseImage',
		'previewImage',
		'uploadImage',
		'downloadImage',
		'getNetworkType',
		'openLocation',
		'getLocation',
		'hideOptionMenu',
		'showOptionMenu',
		'closeWindow',
		'scanQRCode',
		'chooseWXPay',
		'openProductSpecificView',
		'addCard',
		'chooseCard',
		'openCard',
		'openAddress'
	];
	</script>

<body>

<div class="am-modal am-modal-alert" tabindex="-1" id="fq_alert">
  <div class="am-modal-dialog">
    <div class="am-modal-hd" id="fq_alert_title"></div>
    <div class="am-modal-bd" id="fq_alert_info">
    </div>
    <div class="am-modal-footer">
      <span class="am-modal-btn">确定</span>
    </div>
  </div>
</div>

<div class="am-modal am-modal-confirm" tabindex="-1" id="fq_confirm">
  <div class="am-modal-dialog">
    <div class="am-modal-hd" id="fq_confirm_title"></div>
    <div class="am-modal-bd" id="fq_confirm_info"></div>
    <div class="am-modal-footer">
      <span class="am-modal-btn" data-am-modal-confirm>确定</span>
    </div>
  </div>
</div>

<link rel="stylesheet" href="{$plus}dan/mobile/css/face.css" />
<script src="{$plus}dan/mobile/js/Share/face.js"></script>
<div class="release">
    <header style="position:relative;z-index:999;background:{if $setting['color']==1}#FA800A{else}#f8285c{/if};">

    <a href="javascript:void(0);"  onclick="back();" style="position:absolute;top:2px;color:#fff;width:45px;height:100%;padding-left:10px;font-size:25px;" class="am-inline-block am-text-middle am-icon-angle-left"><!-- <img src="Public/assets/mobile/images/left.png" />--></a><div class="am-per-center am-text-center am-padding-vertical-sm" style="color:#fff;font-size:16px;">晒单发布</div>

</header>

<script language="javascript">



  

</script>


<script>

    function back(){
       var last_page_url = (document.referrer);
       if(last_page_url){
          	window.history.back();
		}else{
			window.location.href ='{php echo $this->createMobileUrl('show_dan', array('op' => 'index'))}';
		}
    }

</script>
    <ul class="am-tabs-nav am-nav am-nav-tabs am-avg-sm-4" id="nav2">
        
        <ul class="am-tabs-nav am-nav am-nav-tabs" id="nav2">
        <li style="padding-left:0;padding-right:0;"><a href="{php echo $this->createMobileUrl('show_dan', array('op' => 'index'))}">晒单广场</a></li> 


<li style="padding-right:0;padding-left:0;">
{if $setting['duihuantype']==1 || empty($setting['duihuantype'])}
              <a href="{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=activity&a=coupon">积分兑换</a>
			 {/if}

			 {if $setting['duihuantype']==2}
              <a href="{php echo $this->createMobileUrl('duiba')}">积分兑换</a>
			 {/if}

			 {if $setting['duihuantype']==3}
              <a href="{$setting['duihuanurl']}">积分兑换</a>
			 {/if}
</li>


        <!--li style="padding-left:0;padding-right:0;"><a href="{php echo $this->createMobileUrl('show_dan', array('op' => 'my'))}">我的晒单</a></li>
        <li style="padding-left:0;padding-right:0;"><a href="{php echo $this->createMobileUrl('show_dan', array('op' => 'rank'))}">晒单排行</a></li-->
        <li style="float:right;"><a class="am-fr am-text-sm am-padding-horizontal-xs top_refer" style="background-color:#FFF;border:.1rem solid #F3E7E3;padding-top:3px;padding-bottom:3px;margin-top:6px;margin-bottom:6px;" href="{php echo $this->createMobileUrl('show_dan', array('op' => 'add'))}">我要晒单</a></li>
    </ul>
    </ul>
<style>
    #nav2{
        margin:0;
    }
    #nav2 li{
        height:100%;
        padding:0 5px;
    }
    #nav2 li.am-active{
        border-bottom:.3rem solid {if $setting['color']==1}#FA800A{else}#f8285c{/if};
    }
    #nav2 li.am-active a{
        color:{if $setting['color']==1}#FA800A{else}#f8285c{/if};
    }
    #nav2 li a{
        border:0;
        padding:10px 5px;
        font-size:1.4rem;
        color:#3d0505;
    }
    .release{
        margin-bottom:49px;color:#3D0505;font-family:'Microsoft YaHei';
    }
    .top_nav{
        margin:0;
        padding:5px 0 0 10px;
        list-style:none;
    }
    .top_nav li{
        float:left;
    }
    .top_nav li a.am-active{
        border-bottom:2px solid {if $setting['color']==1}#FA800A{else}#f8285c{/if};
    }
    .release hr{
        margin:5px 0 10px;
        background-color:#f8f8f8;
        border:0;height:.5rem
    }
    #evaluation{
        width:100%;
        padding:0.625em;
        outline:none;
        /*border-color:rgb(25, 167, 240);*/
    }
    #order{
        width:70%;
        margin:0 auto;
        outline:none; 
        border-radius:4px;
        border:1px solid {if $setting['color']==1}#FA800A{else}#f8285c{/if};
        font-weight:normal;
    }
    .star i{
        color:rgb(255,215,000);
    }
    #price{
        width:18%;
        border:1px solid {if $setting['color']==1}#FA800A{else}#f8285c{/if};
        padding:3px 5px;
        border-radius:4px;
    }
    #face{
        position:relative;
    }
    #face,#image{
        display:inline-block;
    }
    #submit{
        padding:3px 12px;
        background-color:{if $setting['color']==1}#FA800A{else}#f8285c{/if};
        color:#fff;
        border-radius:4px;
        position:absolute;
        right:0;
        top:0;
        bottom:0;
    }
    #imagebox img{
        width:55px;
        height:55px;
        margin-right:5px;
    }
    .function{
        position:relative;
        height:32px;
        line-height:32px;
    }
    .pos{
        position:relative;
        top:1px;
    }
     .nav.am-active{
        color:{if $setting['color']==1}#FA800A{else}#f8285c{/if};
    }
    .nav{
        color:#3d0505;
        display:inline-block;
    }
    .am-nav-tabs{
        border-bottom:0.1rem solid #f3e7e3;
    }
    .am-form-field{
        font-size:1.4rem;
    }
</style>
    <div class="am-cf"></div>
    <div class="am-margin-horizontal-sm am-margin-top-sm">

        <input type="text" style="width:70%;-webkit-appearance:none;" class="am-center am-text-center am-padding-xs am-text-sm" placeholder="请粘贴订单号" id="order" />

        <p class="am-text-center am-text-xs am-margin-top-xs am-margin-bottom-sm">可复制淘宝订单号至上面的订单号输入框</p>
    </div>
    <hr />
    <div class="am-margin-horizontal-sm am-margin-top-xs am-text-sm" style="background:#FFF;">



        <span class="pos">到手价:</span>



        <input type="text" id="price" class="am-inline" style="-webkit-appearance:none;" />



        <div class="am-inline pos star">
            <span>&nbsp;&nbsp;&nbsp;评分：</span>
            <i data-id="1" id="star1" class="am-icon-star-o"></i> 
            <i data-id="2" id="star2" class="am-icon-star-o"></i> 
            <i data-id="3" id="star3" class="am-icon-star-o"></i> 
            <i data-id="4" id="star4" class="am-icon-star-o"></i> 
            <i data-id="5" id="star5" class="am-icon-star-o"></i>
            &nbsp;&nbsp;<span id="star_tip"></span>
            <input type="hidden" value="" id="item_star" name="star" />



        </div>



    </div>







    <div class="am-margin-horizontal-sm am-margin-top-xs">



        <textarea name="" id="evaluation" rows="4" class="am-form-field am-text-sm" placeholder="点评一下这件产品吧!"></textarea>



        <div id="Zone" class="am-hide"></div>



    </div>







    <div class="am-margin-horizontal-sm am-margin-top-xs function  am-text-sm">

        <div id="face" class="am-text-warning am-margin-right-sm"><i class="am-icon-smile-o"></i> 表情</div>

        <div id="image" class="am-text-success"><i class="am-icon-image"></i> 添加图片(<span id="image_count">0</span>/5)</div>

        <button type="button" class="am-btn am-radius am-text-sm" id="submit">发布</button>

    </div>



    <div id="imagebox" class="am-margin-sm"></div>







    <hr />







    <div class="am-margin-sm am-text-sm">

       

        <span style="color:#C98080;"><i class="am-icon-bullhorn"></i>奖励规则：

            
                提交您通过本平台复制淘口令下单购买的商品订单号，以及提交至少1张实物图进行晒单，可获得积分奖励！晒多图更有机会额外获得奖励哦。（请上传实物拍摄图，勿传截图无意义图或带广告性质文字，否则将扣除积分）
        </span>

        <br />



        <a href="javascript:void(0);" style="color:#C98080;text-decoration:underline;" id="tips">如何获取订单号?点此查看</a>



    </div>



</div>



<div class="menu">
        <ul class="am-avg-sm-3 am-text-center am-padding-top-xs">
            <li class="am-vertical-align">
                <a href="{php echo $this->createMobileUrl('index', array('op' => 'new'))}">
                    <img src="{$plus}dan/mobile/images/personal/home-page-unact.png" class="am-text-center am-vertical-align-middle"/>
                    <br />               
                    <span class=" am-text-center am-vertical-align-middle">首页</span>
                </a>
            </li>
            <li  class="am-vertical-align">
                <a href="{php echo $this->createMobileUrl('show_dan', array('op' => 'index'))}">
                    <img src="{$plus}dan/mobile/images/personal/Inordertoshare-act.png" class="am-text-center am-vertical-align-middle" />
                    <br />
                    <span class=" am-text-center am-vertical-align-middle">晒单广场</span>
                </a>
            </li>
            <li  class="am-vertical-align">
                <a href="{php echo $this->createMobileUrl('uc')}">
                    <img src="{$plus}dan/mobile/images/personal/per-center-unact.png" class="am-text-center am-vertical-align-middle" />
                    <br />
                    <span class=" am-text-center am-vertical-align-middle">个人中心</span>
                </a>
            </li>
        </ul>
    </div><style>
.menu{
        width:100%;
        position:absolute;
        position:fixed;

        bottom:0;
        background:#fff;
        border-top:.1rem solid #F3E7E3;
        z-index:999;
    }
    .menu img {
        width:1.5rem;
        height:1.5rem;
        margin-bottom:.2rem;
    }

    .menu a {
        display:inline-block;
        color:#3d0505;

    }

    .menu a span {
        font-size:1.2rem;
    }
</style>



<footer class="am-footer am-footer-default">



</footer>



<div class="am-hide"></div>		
</body>
</html>



<!-- modal start -->



<div class="am-modal am-modal-alert" tabindex="-1" id="fq_tips_alert">



    <div class="am-modal-dialog" style="border-radius:6px;max-width:392px;">



        <div class="am-modal-hd modal-hd-top" style="padding:.6rem 4rem;font-size:1.4rem;color:#c98080">



            订单编号在你手机淘宝的订单详情里哟~



        </div>



        <div class="am-modal-hd" style="padding-top:0;padding-bottom:.6rem;font-size:1.4rem;color:#c98080">



            ——— 示例 ———



        </div>



        <div class="am-modal-hd" style="padding-top:0;padding-bottom:.6rem;font-size:1.4rem;">



            <img src="{$plus}dan/mobile/images/order_tips.png" style="max-width:100%;display:block;" />



        </div>



        <div class="am-modal-bd" id="fq_tips_alert_info" style="border-bottom:0;padding:0;padding-bottom:.6rem;">



            <button type="button" style="border:0.1rem solid {if $setting['color']==1}#FA800A{else}#f8285c{/if};background:{if $setting['color']==1}#FA800A{else}#f8285c{/if};padding:2px 40px;color:{if $setting['color']==1}#FA800A{else}#f8285c{/if};border-radius:4px; color:white" data-am-modal-close>确定</button>



        </div>



    </div>



</div>



<!-- modal end -->



<script>

    function share_refer(){

        window.location.href = '{php echo $this->createMobileUrl('show_dan', array('op' => 'index'))}';

    }

    function reindex()
　　{
　　var go=setTimeout("share_refer()",2000)
　　}

    

    wx.ready(function(){

        //上传图片

        function uploadImage(localIds,i,len){

            if(i > len-1){

                return;

            }

            wx.uploadImage({

                localId:localIds[i], // 需要上传的图片的本地ID，由chooseImage接口获得

                success: function (data) {

                    var serverId = data.serverId; // 返回图片的服务器端ID

                    if(serverId){

                        img.push(serverId);

                        $('#imagebox').append('<img src="'+localIds[i]+'" class="imagearray">');

                        var img_num = $('#image_count').text();

                        $('#image_count').text(parseInt(img_num)+1);

                        var next = i+1;

                        uploadImage(localIds,next,len);

                    }

                },

            });

        }

        //添加图片

        $('#image').click(function(){

            var len = $('#imagebox img').length;

            if(len >= 5){

                $('#fq_alert_info').text('上传图片太多啦！');

                $('#fq_alert').modal({});

                return false;

            }

            var count = 5 - parseInt(len);

            wx.chooseImage({

                count:count,

                sizeType: ['original', 'compressed'], 

                sourceType: ['album', 'camera'], 

                success: function (res) {

                    var localIds = res.localIds;

                    var imgLen = localIds.length;

                    uploadImage(localIds,0,imgLen);

                }

            })

        });



    });

    //图片容器

    var img = new Array();



    $(document).ready(function() { 



        //表情

        $("#face").facebox({

            Event : "click",    //触发事件  

            divid : "face", //外层DIV ID

            textid : "evaluation" //文本框 ID

        });



        $('#submit').click(function(){



            var grade = $("#item_star").val();



            if(!grade){

                $('#fq_alert_info').text('亲，请对本次活动评分吧！');

                $('#fq_alert').modal({});

                return false;



            }



            var evaluation  =  $.trim($("#evaluation").val());

            if(evaluation.length < 5){

                $('#fq_alert_info').text('亲，至少要说5个字啦！');

                $('#fq_alert').modal({});

                return false;



            }

            //订单号 16位 数字



            var order = $.trim($('#order').val());



            if(order == ''){

                $('#fq_alert_info').text('亲，请输入您的订单号！');

                $('#fq_alert').modal({});

                return false;



            }



            if(order.match(/^\d{16}$/) == null){



                $('#fq_alert_info').text('亲，订单号为16位的数字哦！');

                $('#fq_alert').modal({});

                return false;

            }



            var price = $.trim($('#price').val());

            if(price == ''){

                $('#fq_alert_info').text('亲，请输入商品的到手价！');

                $('#fq_alert').modal({});

                return false;

            }



            if(price.match(/^\d{1,}\.{0,1}\d{0,2}$/) == null){

                $('#fq_alert_info').html('亲，请输入正确的到手价！<br />(最多保留两位小数)');

                $('#fq_alert').modal({});

                return false;



            }



            if(img.length == 0){

                $('#fq_alert_info').text('亲，至少传一张图啦！');

                $('#fq_alert').modal({});

                return false;

            }

            $('#Zone').replaceface($('#evaluation').val());

            var evaluation_has_face = $('#Zone').html();

            $(this).html('<i class="am-icon-spinner am-icon-spin"></i> 发布中').attr('disabled',true);

            $.ajax({

                type:'post',

                url:'{php echo $this->createMobileUrl('show_dan', array('op' => 'addajax'))}',

                dataType:'json',

                data:{"grade":grade,"order":order,"evaluation":evaluation_has_face,"price":price,"img":img},

                success:function(res){

                    if(res.status == 1){
                        
                        $('#fq_alert_info').html(res.info);

                        $('#fq_alert').modal();

                        $('#submit').text('发布').attr('disabled',false);
                         

						reindex();
                        return;

                       // window.location.href='{php echo $this->createMobileUrl('show_dan', array('op' => 'index'))}';

                    }else if(res.status == 0){

                        $('#fq_alert_info').html(res.info);

                        $('#fq_alert').modal({});

                        $('#submit').text('发布').attr('disabled',false);

                        return;

                    }else{

                        $('#fq_alert_info').html(res.info);

                        $('#fq_alert').modal({});

                        $('#submit').text('发布').attr('disabled',false);

                        return;

                    }

                },

                complete:function(XMLHttpRequest,status){

                    if(XMLHttpRequest.status != 200){

                        $('#fq_alert_info').text('连接超时，请检查网络');

                        $('#fq_alert').modal({});

                        $('#submit').text('发布').attr('disabled',false);

                    }

                    

                }

            });

        });



        //评分



        $(".am-icon-star-o").on('click', function() {



            var id = $(this).data('id');



            switch(id){



                case 1:$("#star_tip").text("讨厌");break;



                case 2:$("#star_tip").text("不喜欢");break;



                case 3:$("#star_tip").text("喜欢");break;



                case 4:$("#star_tip").text("很喜欢");break;



                case 5:$("#star_tip").text("超赞");break;



            }



            $('#item_star').val(id);



            $(".am-icon-star").attr("class","am-icon-star-o");



            for(i=1;i<=id;i++){



                $("#star"+i).attr("class","am-icon-star");



            }



            



        });







        //获取订单号提示框



        $('#tips').click(function(){



            $('#fq_tips_alert').modal({});



        });



    });



</script>

<script type="text/javascript">
	$(function(){
$('.am-modal-btn').css('color','{if $setting['color']==1}#FA800A{else}#f8285c{/if}');
{if $_GPC['do']=='uc'}
{if empty($user)}
layer.msg('对不起，您无权访问', {
  shade: [0.8, '#393D49'],
  closeBtn: 0
}, function(){window.location.href="{php echo $this->createMobileUrl('index')}";});
{/if}
{/if}


{if $_GPC['do']=='show'}
var url = "{php echo $this->createMobileUrl('hit_ajax',array('id'=>$_GPC['id'],'act'=>'item'));}";		
$.post(url, function(dat){
dat = eval('('+dat+')');
});
{/if}


	wx.config(jssdkconfig);
	var $_share = {php echo json_encode($_share);};
	if(typeof sharedata == 'undefined'){
		sharedata = $_share;
	} else {
		sharedata['title'] = sharedata['title'] || $_share['title'];
		sharedata['desc'] = sharedata['desc'] || $_share['desc'];
		sharedata['link'] = sharedata['link'] || $_share['link'];
		sharedata['imgUrl'] = sharedata['imgUrl'] || $_share['imgUrl'];
	}
	if(sharedata.imgUrl == ''){
		var _share_img = $('body img:eq(0)').attr("src");
		if(_share_img == ""){
			sharedata['imgUrl'] = window.sysinfo.attachurl + 'images/global/wechat_share.png';
		} else {
			sharedata['imgUrl'] = util.tomedia(_share_img);
		}
	}
	if(sharedata.desc == ''){
		var _share_content = util.removeHTMLTag($('body').html());
		if(typeof _share_content == 'string'){
			sharedata.desc = _share_content.replace($_share['title'], '')
		}
	}
	wx.ready(function () {

		wx.onMenuShareAppMessage(sharedata);
		wx.onMenuShareTimeline(sharedata);
		wx.onMenuShareQQ(sharedata);
		wx.onMenuShareWeibo(sharedata);

        sharedata.success = function(){

{if $_GPC['do']=='show'}
var url = "{php echo $this->createMobileUrl('share_ajax',array('id'=>$_GPC['id'],'act'=>'item'));}";		
$.post(url, function(dat){
dat = eval('('+dat+')');
});
{/if}   
	    }


	});

	});
</script>

{if $follow!=1}
<script>
layer.open({
	
	title:'-发布晒单，请先长按下图-',
    content: '<center><div style="width:100%;"><br><img src="{$_W['account']['qrcode']}" width="100%"><br><font color="red">本功能仅限会员使用</font></div></center>',
    btn: ['返回首页', '返回微信'],
    shadeClose: false,
	closeBtn: false,
    yes: function(){
       window.location.href='{php echo $this->createMobileUrl('index', array('op' => 'new'))}';	
    }, no: function(){
		WeixinJSBridge.call('closeWindow');
    }
});
</script>
{/if}